import { http } from '@/utils/http'
import type { LoginResult } from '@/types/member'

//获取请求参数,响应参数写在types文件下
type LoginParams = {
  code:string,
  encryptedData:string,
  iv:string
}
/**
 * 小程序登入,需要企业uuid，没有
 * @param data
 */
export const postLoginWxMinApi = (data:LoginParams) => {
  return http<LoginResult>({
    method:'POST',
    url:'/login/wxMin',
    data,
  })
}

/**
 * 使用这个接口进行模拟手机登录(开发环境)
 * /login/wxMin/simple
 * phoneNumber 模拟手机号码
 */
export const postLoginWxMinSimpleApi = (phoneNumber:string) => {
  return http<LoginResult>({
    method:'POST',
    url:'/login/wxMin/simple',
    data:{
      phoneNumber
    }
  })
}
